package com.example.verification.demo.merchant.repository.impl;

import com.example.verification.demo.merchant.repository.IMerchantRepository;
import org.springframework.stereotype.Repository;

import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by hzy on 2018/12/13.
 */
@Repository
public class MerchantRepositoryImpl implements IMerchantRepository {
    private static final ConcurrentHashMap<String,String> keyCache = new ConcurrentHashMap<>();
    static {
        keyCache.put("frank","192006250b4c09247ec02edce69f6a2d");
        keyCache.put("jack","0b4c09247ec0192006252edce69f6a2d");
    }

    /**
     * 根据商户Id查询商户
     * @param merchantId
     * @return
     */
    @Override
    public String findKeyByMerchantId(String merchantId) {
        return keyCache.get(merchantId);
    }
}
